package com.bw.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bw.bean.ActiveUser;


@Controller

@RequestMapping("index")
public class PageIndex {
	
	/*跳转到登录页面
	 * */
	@RequestMapping("/toIndexpage")
	public String index(HttpServletRequest request){
			System.err.println("进来了吗");
		    //从shiro的sesssion中获取activeUser
		
			Subject subject = SecurityUtils.getSubject();
			ActiveUser activeUser= (ActiveUser)subject.getPrincipal();
			request.getSession().setAttribute("activeUser",activeUser);
			
		   return "index";
	}
}
